# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_LocationGroupInfo do
  @moduledoc """
  A radius around a list of locations specified through a feed.

  ## Attributes

  *   `feedItemSets` (*type:* `list(String.t)`, *default:* `nil`) - FeedItemSets whose FeedItems are targeted. If multiple IDs are specified, then all items that appear in at least one set are targeted. This field cannot be used with geo_target_constants. This is optional and can only be set in CREATE operations.
  *   `geoTargetConstants` (*type:* `list(String.t)`, *default:* `nil`) - Geo target constant(s) restricting the scope of the geographic area within the feed. Currently only one geo target constant is allowed.
  *   `radius` (*type:* `String.t`, *default:* `nil`) - Distance in units specifying the radius around targeted locations. This is required and must be set in CREATE operations.
  *   `radiusUnits` (*type:* `String.t`, *default:* `nil`) - Unit of the radius. Miles and meters are supported for geo target constants. Milli miles and meters are supported for feed item sets. This is required and must be set in CREATE operations.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :feedItemSets => list(String.t()) | nil,
          :geoTargetConstants => list(String.t()) | nil,
          :radius => String.t() | nil,
          :radiusUnits => String.t() | nil
        }

  field(:feedItemSets, type: :list)
  field(:geoTargetConstants, type: :list)
  field(:radius)
  field(:radiusUnits)
end

defimpl Poison.Decoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_LocationGroupInfo do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_LocationGroupInfo.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_LocationGroupInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
